package com.ycw.service.wang.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ycw.bean.Users;
import com.ycw.dao.UsersMapper;
import com.ycw.service.wang.UsersService;


@Service("wUsersServiceImpl")
public class UsersServiceImpl implements UsersService {
	@Autowired
	UsersMapper usersMapper;

	@Override
	public List<Users> getUsers() {
		List<Users> list = usersMapper.selectAll();
		return list;
	}

	@Override
	public Users getAllByUsId(Integer usId) {
		Users users = usersMapper.selectByPrimaryKey(usId);
		return users;

	}

	// 登录
	@Override
	public Users getUsersByCondition(Users users) {
		users = usersMapper.selectOne(users);

		return users;
	}

	@Override
	public boolean updateUsRole(Users users) {
		int i = usersMapper.updateByPrimaryKeySelective(users);
		if (i > 0) {
			return true;
		}
		return false;
	}

}
